<?php

namespace app\index\middleware;

use think\facade\Session;

class isLogin
{
    public function handle($request, \Closure $next)
    {
        if(!Session::has('user')){
            echo "<script>window.location.href='/index/login/index'</script>";
            exit;
        }
        return $next($request);
    }
}
